/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */

package com.ykht.proj.coupon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykht.proj.coupon.entity.CnBrand;
import com.ykht.proj.coupon.entity.CnCoupon;
import com.ykht.proj.coupon.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/**
 * 品牌表
 *
 * @author proj code generator
 * @date 2020-11-16 17:00:21
 */
@Mapper
public interface CnBrandMapper extends BaseMapper<CnBrand> {

	List<CnBrandVo> queryPage(Page page, @Param("map") HashMap map);

	PinPaiGuanVo pinPaiGuanPinPai(@Param("brandId")Long brandId);
	List<CnBrandVo> queryPage(Page page, @Param("map") CnBrandVo cnBrandVo);

	IPage<PinPaiGuanVo> opPpgId(Page page, @Param("req")CnBrand cnBrand);

	PpgDetailResp brandAndLabelById(Long id);
	List<CnBrandLabel> brandAndLabelByIds(@Param("ids") List<Long> ids);

	void updateCountplus(Long brandId);

	void updateCountreduce(Long brandId);

    List<CnCouponVo> findCouponByShopId(Long brandId,String couponName);

    Long queryByUserId(Long userId);

    void add1TyCouponCountByBrandId(Long brandId);

	/**
	 * S-01首页（品牌）分页查询
	 *
	 * @param page           分页
	 * @param homePageSearch 条件
	 * @return
	 */
    IPage<CnBrandVo> getCmsBrandPage(Page page, @Param("req") HomePageSearch homePageSearch);
}
